create a script to create a module file#203
Merged
dietmarkuehl merged 25 commits intomainfrom Jan 31, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces infrastructure to generate a C++20 module interface for beman.execution and refactors the library/test code to better support module-based consumption.
Changes:
- Add
bin/mk-module.pyto generate abeman.executionmodule interface from the existing header structure. - Annotate public API surface with
BEMAN_EXECUTION_EXPORTand adjust headers to support module export generation (plus include-guard/comment cleanups). - Update tests (and some examples/docs/build config) to optionally use
import beman.execution;instead of including headers.
Reviewed changes
Copilot reviewed 246 out of 249 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/beman/execution/stoptoken-never-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stoptoken-mem.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stoptoken-inplace-members.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stoptoken-inplace-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stoptoken-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopsource-mem.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopsource-inplace-mem.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopsource-inplace-cons.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopsource-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopsource-cons.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback-inplace.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback-inplace-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback-inplace-cons.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stopcallback-cons.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/stop-token-module.test.cpp | Switch to import beman.execution; for module-specific test. |
| tests/beman/execution/issue-186.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/issue-174.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/issue-144.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/include/test/stop_token.hpp | Add conditional module import vs header include for test helper header. |
| tests/beman/execution/include/test/execution.hpp | Adjust test namespace aliases and add use_type/use_template helpers. |
| tests/beman/execution/functional-syn.test.cpp | Update references from test_std::detail to test_detail. |
| tests/beman/execution/function-objects.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/execution-queryable-concept.test.cpp | Update references from test_std::detail to test_detail. |
| tests/beman/execution/execution-module.test.cpp | Switch module test to import beman.execution; and align aliases to test_std. |
| tests/beman/execution/exec-with-awaitable-senders.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-when-all.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-then.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-starts-on.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-split.test.cpp | Update detail-type references to use test_detail. |
| tests/beman/execution/exec-spawn-future.test.cpp | Update detail-type references to use test_detail. |
| tests/beman/execution/exec-snd-transform.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-snd-expos.test.cpp | Update queryable references to use test_detail. |
| tests/beman/execution/exec-snd-apply.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-set-value.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-set-stopped.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-set-error.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-scope-simple-counting.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-scope-counting.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-scope-concepts.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-schedule.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-schedule-from.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-sched.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-run-loop-types.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-run-loop-general.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-recv.test.cpp | Update references from test_std::detail to test_detail. |
| tests/beman/execution/exec-read-env.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-prop.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-opstate.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-opstate-start.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-on.test.cpp | Simplify construction using test_detail::product_type. |
| tests/beman/execution/exec-let.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-just.test.cpp | Update detail-type references to use test_detail. |
| tests/beman/execution/exec-into-variant.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-getcomplsigs.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-stop-token.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-scheduler.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-env.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-domain.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-delegation-scheduler.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-get-compl-sched.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-fwd-env.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-env.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-connect.test.cpp | Update detail-type references to use test_detail. |
| tests/beman/execution/exec-bulk.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-awaitable.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-associate.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/exec-affine-on.test.cpp | Add conditional module import vs header include. |
| tests/beman/execution/CMakeLists.txt | Adjust test list and attempt to wire module build definitions. |
| include/beman/execution26/stop_token.hpp | Normalize include guards and add trailing #endif comment. |
| include/beman/execution26/execution.hpp | Normalize include guards and add trailing #endif comment. |
| include/beman/execution/stop_token.hpp | Add trailing #endif comment. |
| include/beman/execution/functional.hpp | Add trailing #endif comment. |
| include/beman/execution/execution.hpp | Include split.hpp and add trailing #endif comment. |
| include/beman/execution/detail/common.hpp | Introduce BEMAN_EXECUTION_EXPORT marker macro. |
| include/beman/execution/detail/write_env.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/with_awaitable_senders.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/with_await_transform.hpp | Include common.hpp. |
| include/beman/execution/detail/when_all_with_variant.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/when_all.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/value_types_of_t.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/error_types_of_t.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/transform_sender.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/then.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/sync_wait.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/start.hpp | Mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/split.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/schedule.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/connect.hpp | Include common.hpp and export connect CPO via BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/as_awaitable.hpp | Include common.hpp and mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/forwarding_query.hpp | Mark API with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/get_* (multiple) | Include common.hpp and mark CPOs/types with BEMAN_EXECUTION_EXPORT. |
| include/beman/execution/detail/* (many others) | Include common.hpp, add BEMAN_EXECUTION_EXPORT to exported surface, and normalize #endif comments. |
| examples/allocator.cpp | Use exported ex::write_env instead of ex::detail::write_env. |
| docs/code/CMakeLists.txt | Comment out module example build wiring. |
| bin/mk-module.py | New script to generate a module interface file from headers and BEMAN_EXECUTION_EXPORT markers. |
| Makefile | Enable CMAKE_CXX_SCAN_FOR_MODULES. |
| .gitignore | Ignore gcm.cache. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Quickfix to make it work with g++-15 on OSX * Disable CI test with clang++ and libstd++ * Use GenerateExportHeader cmake module
Collaborator
|
@dietmarkuehl I was still working to make CI happy. [17/173] Building CXX object src/beman/execution/CMakeFiles/execution_headers_verify_interface_header_sets.dir/Release/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx.o
FAILED: [code=1] src/beman/execution/CMakeFiles/execution_headers_verify_interface_header_sets.dir/Release/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx.o
/usr/sbin/g++ -DCMAKE_INTDIR=\"Release\" -I/__w/execution/execution/include -x c++ -O3 -O3 -DNDEBUG -std=gnu++23 -MD -MT src/beman/execution/CMakeFiles/execution_headers_verify_interface_header_sets.dir/Release/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx.o -MF src/beman/execution/CMakeFiles/execution_headers_verify_interface_header_sets.dir/Release/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx.o.d -o src/beman/execution/CMakeFiles/execution_headers_verify_interface_header_sets.dir/Release/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx.o -c /__w/execution/execution/build/src/beman/execution/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx
In file included from /__w/execution/execution/build/src/beman/execution/execution_headers_verify_interface_header_sets/beman/execution/detail/associate.hpp.cxx:2:
/__w/execution/execution/include/beman/execution/detail/associate.hpp:90:38: error: 'nothrow_callable' is not a member of 'beman::execution::detail'
90 | execution::detail::nothrow_callable<::beman::execution::connect_t,
| ^~~~~~~~~~~~~~~~
/__w/execution/execution/include/beman/execution/detail/associate.hpp:92:55: error: wrong number of template arguments (3, should be 1)
92 | Receiver>> {};
| ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/concepts:44,
from /__w/execution/execution/include/beman/execution/detail/queryable.hpp:8,
from /__w/execution/execution/include/beman/execution/detail/env.hpp:9,
from /__w/execution/execution/include/beman/execution/detail/sender.hpp:8,
from /__w/execution/execution/include/beman/execution/detail/scope_token.hpp:8,
from /__w/execution/execution/include/beman/execution/detail/associate.hpp:8:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/type_traits:98:11: note: provided for 'template<bool __v> using std::bool_constant = std::integral_constant<bool, __v>'
98 | using bool_constant = integral_constant<bool, __v>;
| ^~~~~~~~~~~~~
/__w/execution/execution/include/beman/execution/detail/associate.hpp:92:63: error: expected '{' before '>' token
92 | Receiver>> {};
| |
…breaking other things)
Member
Author
It didn't seem to be a draft! ... and I think my version was also unhappy. |
* Install header only library and cxx_module lib Prevent build errors with appleclang too * Fix: APPLE with clang++ still needs to export CXX=clang++ Quickfix: use import beman.execution; Show #warning if __cpp_modules is not set right Quickfix: do not compile examles/modules.cpp yet * Add find-package-test and fix typos
This was referenced Jan 30, 2026
This was referenced Jan 30, 2026
* Cleanup and use BEMAN_HAS_MODULES in code * Quickfix to compile all tests for now
* Feat: configure project to test without modules * Use beman-install-library-config.cmake * Fix installation without cxx_modules * Add support for CMAKE_SKIP_INSTALL_RULES * The final cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current code structure isn’t particular friendly to modules. Since the relevant file follow a certain structure it is easy to transform the code and create a file which is friendly modules. This is what
bin/mk-module.pydoes. Currently the result is checked in asstc/beman/exectution/execution.cppm.This PR makes lots of changes to bring make the structure actually consistent, adding a macro to expand to
exportwhere appropriate, etc.